// 源字符串，要高亮的片段
export const heightLight = (str, key) => {
  const reg = new RegExp(key, 'ig')
  // str.replace(正则,(匹配到的内容)=> { return 要替换的结果 } )
  return str.replace(reg, (val) => {
    return `<span style="color:red">${val}</span>`
  })
}
